<script lang="ts" setup>
import PageHeader from '../../../components/page-header.vue';
import IndicatorSource from '@/components/indicator-source/index.vue';
import { getSgPerformance } from '../../../apis';
import IndicatorTable from '../../../components/indicator-table.vue';
import { useF9Context } from '@/views/modules/enterprise/use/use-context';

interface Props {
  title: string;
  menuId: string;
  count?: number;
  code: number
}

const { title, menuId, count, code } = defineProps<Props>();

const { companyId } = useF9Context();

const requestParams = reactive<any>({
  companyId,
  classificationCodeLevel1: code
});

const {
  data: originData,
  run,
  loading,
  error
} = useRequest(getSgPerformance, {
  defaultParams: [requestParams]
});


</script>
<template>
  <page-header class="mt-18px mb-15px" :count="count" :title="title" :menuId="menuId" is-small />

  <vc-empty-fail @click="run(requestParams)" v-if="error" />
  <div class="container" v-else>
    <indicator-table :loading="loading" :details-data="originData?.details" :years-data="originData?.years" isSocialGovernance/>

    <!-- <vc-table :loading="loading" :tableData="tableData" :columns="columns" v-model:pageNum="requestParams.pageNum" @sort-change="sortChange" /> -->
  </div>
</template>

